# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=tree-sitter-cli
pkgver=0.24.3
pkgrel=0
pkgdesc="Tree Sitter CLI"
url="https://tree-sitter.github.io/"
arch="all"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/tree-sitter-$pkgver"
options="!check" # fail in this release

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked

	sh ./script/fetch-fixtures
}

build() {
	cargo auditable build -p tree-sitter-cli --frozen --release
}

check() {
	cargo test -p tree-sitter-cli --frozen
}

package() {
	install -Dm755 target/release/tree-sitter -t "$pkgdir"/usr/bin/
}

sha512sums="
2d934c03b0ee71419654d03bf6e4ca759b4ef3217b8837fcaef64ee5b4bc8ea8298ff685ae4aaa477b615d11d538ff960b92529b11f13e936b85bad52e369cd3  tree-sitter-cli-0.24.3.tar.gz
"
